from pywinauto.application import Application

app = Application().start("C:\\Windows\\System32\\notepad.exe")
# app = Application(backend="uia").start("C:\\Windows\\System32\\notepad.exe")

# app.UntitledNotepad.type_keys("%FX")

app.UntitledNotepad.menu_select("帮助->关于记事本")
app.AboutNotepad.OK.click()
app.UntitledNotepad.Edit.type_keys("pywinauto Works!", with_spaces=True)


# app = Application(backend="uia").start('notepad.exe')
#
# # 描述Notepad.exe进程内的窗口
# dlg_spec = app.UntitledNotepad
# # 等到窗户真的开着
# actionable_dlg = dlg_spec.wait('visible')


